[1.17] Add Entity Visibility API#6000
Conversation
Trigary
left a comment
There was a problem hiding this comment.
Unfortunately Level#sendParticles also exists and is used by entities (eg. Squid#spawnInk, LivingEntity#checkFallDamage). You would need to handle that similarly to sounds.
I've now edited sendParticle and playSound for all entities |
|
stuff fixed |
|
bump |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
. |
| com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> lastTrackerCandidates; | ||
|
|
||
| - final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newTrackerCandidates) { | ||
| + public final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newTrackerCandidates) { |
There was a problem hiding this comment.
this is missing a paper comment, and really, it should be a AT
There was a problem hiding this comment.
https://github.com/PaperMC/Paper/blob/master/build-data/paper.at allows you to change access modifiers.
There was a problem hiding this comment.
Cannot use AT for this one because method is added by patch 0431
There was a problem hiding this comment.
then go back to the patch that adds it and change the visibility there.
| public boolean isTicking(); | ||
| // Paper end | ||
| + | ||
| + // Paper start - Entity Visibility API |
There was a problem hiding this comment.
Don't create a new comment "block" here, move it into the already existing one
| Set<Player> getTrackedPlayers(); | ||
| // Paper end | ||
|
|
||
| + // Paper start - Entity Visibility API |
There was a problem hiding this comment.
But litterally a couple lines above the same thing happens already and I think that it also helps to keep patches a little more individual.
| } | ||
| // Paper end | ||
| + | ||
| + // Paper start - Entity Visibility API |
|
Please don't let this die |
…ve unnecessarily qualified access
|
soo I remembered again I had this thing open, please check again |
Machine-Maker
left a comment
There was a problem hiding this comment.
Just as a note, upstream added something that might conflict with this. Probably needs to be considered somehow here.
| com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> lastTrackerCandidates; | ||
|
|
||
| - final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newTrackerCandidates) { | ||
| + public final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newTrackerCandidates) { // Paper - Entity Visibility API - packageprivate -> public |
There was a problem hiding this comment.
Unsure if you saw my comment here, but if this is a method added by paper in a previous patch, you should go back to that patch and change the visibility there to reduce the diff.
Looks like this patch got a little redundant. I will create a PR to upstream with the details upstream ignored (sounds, particles). Edit: So far I did not create any upstream PR for fixes like sound and I don't plan to in the near future, so if anyone wants to do it instead, go ahead. If not, also fine. |
|
Seeing as upstream has merged most of what this pr was meant to bring this will be closed. The whole "hide by default behavior" seems to be covered by another issue which has some PRs for it as well. #7395 Because blocking sounds/particles might still be a wanted feature, feel free to open a separate PR (here or upstream) that covers that specific area while using the current visibility API that upstream has. Thank you for your contribution, and sorry we couldn't get to merge this. |
Closes #5973
This is a port to 1.17 of #5993